package com.example.common;

import android.app.Application;

import com.bumptech.glide.Glide;
import com.example.imageload_sdk.GlideApp;
import com.example.umeng_sdk.UmengManager;

public class BaseApplication extends Application {
    private static BaseApplication instance;

    public static BaseApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        GlideApp.get(this).clearMemory();
        UmengManager.getInstance().initUM(this);
    }
//低内存清除glide缓存
    @Override
    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
        if (level==TRIM_MEMORY_RUNNING_LOW){
            Glide.get(this).clearMemory();
        }
    }
}